<?PHP
 require_once('inc/int.php');
 require_once('inc/news.php');
 require_once('inc/releases.php');

 if (stripos($_SERVER['HTTP_USER_AGENT'], 'win') !== false) {
  define('OS', 'windows');
 } else if (stripos($_SERVER['HTTP_USER_AGENT'], 'linux') !== false) {
  define('OS', 'linux');
 } else {
  define('OS', 'java');
 }

 $news = getNews();
 $mr =& $releases['latest'];
 $mu =& $releases['unstable'];

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>DMDirc</title>
  <link rel="stylesheet" type="text/css" href="res/style.css">
  <link rel="alternate" type="application/rss+xml" title="News feed" href="/feed">
  <link rel="icon" type="image/png" href="res/favicon.png">
 </head>
 <body>
  <div id="container">
   <img id="logo" src="res/logo.png" alt="DMDirc logo">
   <h1>DMDirc</h1>
<?PHP define('PAGE', 'about'); define('SUBPAGE', 'about'); require_once('inc/menu.php'); ?>
   <div>
    <div class="left">
     <h2 style="margin-top: 0px;"><?PHP echo t('menu_about'); ?></h2>
     <p><?PHP echo t('index_intro'); ?></p>
     <div class="features">
      <div class="feature odd">
       <h3><img src="res/features/page_edit.png" alt="A page with a pencil">Free as in speech</h3>
       <p>The DMDirc source code is available for anyone to download and modify</p>
      </div>
      <div class="feature even">
       <h3><img src="res/features/money_pound.png" alt="Pound sign">Free as in beer</h3>
       <p>DMDirc doesn't and will never cost anything to download or use</p>
      </div> 
      <div class="feature odd">
       <h3><img src="res/features/cog.png" alt="Cog">Actions system</h3>
       <p>Execute commands when certain events happen, without using a scripting language</p>
      </div>
      <div class="feature even">
       <h3><img src="res/features/brick_add.png" alt="Brick with a plus sign">Easily extendible</h3>
       <p>Support for plugins, themes and packs of actions to easily extend and customise the client</p>
      </div>
      <div class="feature odd">
       <h3><img src="res/features/colour_wheel.png" alt="Colour wheel">Colourful chat</h3>
       <p>Support for both mIRC and hex colours, as well as bold, italics and more</p>
      </div> 
      <div class="feature even">
       <h3><img src="res/features/tux.png" alt="Tux, the linux penguin">Cross platform</h3>
       <p>Works on Windows, Linux and OS X &mdash; anywhere that can run Java!</p>
      </div>
      <div class="feature odd">
       <h3><img src="res/features/lightbulb.png" alt="Lightbulb">Intelligent behaviour</h3>
       <p>Intelligent tab completion and link detection makes life easier</p>
      </div>
      <div class="feature even">
       <h3><img src="res/features/add.png" alt="Plus sign">And much more&hellip;</h3>
       <p>This isn't all! Why not try DMDirc to see what it can do?</p>
      </div>
     </div>
    </div>
    <div class="right">
     <h2><?PHP echo t('index_get'); ?></h2>
     <a href="<?PHP echo $mr[OS]['url']; ?>" id="download">
      <?PHP printf(t('index_download'), $mr['name']); ?>
      <img src="res/icon/download.png" alt="Download">
     </a>
     <p id="downloadinfo">
      <?PHP echo basename($mr[OS]['url']); ?>, <?PHP echo $mr[OS]['size']; ?>
     </p>
     <ul class="iconed dlinfo">
<?PHP $c = 0; if (isset($mr['changelog'])) { $c++; ?>
      <li><img src="res/icon/changelog.png" alt="Changelog"><a href="<?PHP echo $mr['changelog']; ?>">Changelog</a></li>
<?PHP }; if (isset($mr['releasenotes'])) { $c++; ?>
      <li><img src="res/icon/help.png" alt="Help"><a href="<?PHP echo $mr['releasenotes']; ?>">Release notes</a></li>
<?PHP }; if (isset($mr['knownissues'])) { if ($c++ == 2) { echo '</ul><ul class="iconed dlinfo">'; } ?>
      <li><img src="res/icon/text.png" alt="Text file"><a href="<?PHP echo $mr['knownissues']; ?>">Known issues</a></li>
<?PHP }; if ($c++ == 2){ echo '</ul><ul class="iconed dlinfo">'; } ?>
      <li><img src="res/icon/exe.png" alt="Executable file icon"><a href="downloads">Other versions</a></li>
     </ul>
     <h2 class="extra">Screenshot</h2>
     <div class="sidebarss">
      <a href="screenshots?file=res/screenshots/current/linux/kde/main.png">
       <img src="res/thumb2/screenshots/current/linux/kde/main.png" id="thumbnail" alt="<?PHP echo $mr['name']; ?>">
      </a>
      <p><a href="screenshots">More screenshots</a></p>
     </div>
    </div>
   </div>
   <div style="clear: both; padding-top: 10px;">
    <div class="fleft">
<?PHP
 $first = array_shift($news);
?>
     <h2>
        <a href="feed" class="rss"><img src="res/rss.png" alt="RSS" title="Subscribe to our news feed"></a>
Latest news: <?PHP echo htmlentities($first['title']); ?></h2>
     <?PHP echo ($first['body']); ?>
     <ul class="newslinks">
      <li><a href="<?PHP echo htmlentities($first['link']); ?>">Read more and comment</a></li>
      <li><a href="http://blog.dmdirc.com/category/news/">More news</a></li>
      <li><a href="http://blog.dmdirc.com/">Other entries from the dev blog</a></li>
     </ul>
    </div>
   </div>
   <div id="footer">
   </div>
  </div>
 </body>
</html>
